<script setup lang='ts'>
import { useRouter } from "vue-router";
const router = useRouter()
const data = [
  { icon: 'fire', title: '武器' },
  { icon: 'photo', title: '地图' },
  { icon: 'friends', title: '人物' },
  { icon: 'cluster', title: '物品' },
  { icon: 'audio', title: '客服' },
  { icon: 'comment', title: '文案' },
  { icon: 'video', title: '教程' },
  { icon: 'weapp-nav', title: '更多' },
]
const toUrl = (e: string) => {
  switch (e) {
    case '客服':
      console.log(e);
      break;
    case '文案':
      console.log(e);
      break;
    case '教程':
      console.log(e);
      break;
    case '更多':
    router.push({ name: 'select' })
      break;
    default:
      router.push({ name: 'ThisSelect', query: { type: e } })
      break
  }

}
const toRouter = (e: string) => {
  toUrl(e)
}
</script>

<template>
  <van-grid :gutter="10" clickable>
    <van-grid-item @click="toRouter(i.title)" v-for="(i, index) in data" :key="index" :icon="i.icon" :text="i.title" />
  </van-grid>
</template>

<style scoped></style>